package com.sherpas.android.component.activity;

import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

import com.sherpas.android.R;
import com.sherpas.android.component.activity.base.BaseActivity;

public class LoginActivity extends BaseActivity implements OnClickListener {
	private Button mBtnLogIn, mBtnSignUp;
	private EditText mEdtEmailUser, mEdtPasswordUser, mEdtEmailSherpa,
			mEdtPasswordSherpa;

	@Override
	public void setContentView() {
		setContentView(R.layout.activity_login);
	}

	@Override
	public void initComponents() {
		mEdtEmailUser = (EditText) findViewById(R.id.edt_email_user);
		mEdtPasswordUser = (EditText) findViewById(R.id.edt_password_user);
		mEdtEmailSherpa = (EditText) findViewById(R.id.edt_email_sherpa);
		mEdtPasswordSherpa = (EditText) findViewById(R.id.edt_password_sherpa);
		mBtnLogIn = (Button) findViewById(R.id.btn_login);
		mBtnSignUp = (Button) findViewById(R.id.btn_sign_up);
	}

	@Override
	public void addListeners() {
		mBtnLogIn.setOnClickListener(this);
		mBtnSignUp.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_login:
			if (mEdtEmailUser.getText().toString().trim().length() > 0) {
				startActivity(new Intent(this, UserStartActivity.class));
				finish();
			} else {

			}
			break;
		case R.id.btn_sign_up:
			startActivityForResult(new Intent(this, SignUpActivity.class), 100);
			break;
		default:
			break;
		}
	}

}
